package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.PromotionProductEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface PromotionProductDao {
    Long insert(PromotionProductEntity entity);

    void insertBatch(List<PromotionProductEntity> list);

    PromotionProductEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(PromotionProductEntity entity);

    List<PromotionProductEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    Integer deleteByRefId(@Param("refId") Long refId,@Param("corpid") String corpid);

    List<PromotionProductEntity> getProductsByRefId(@Param("refId") Long refId,@Param("corpid") String corpid);

    Integer updateCategorybyProductId(@Param("categoryId")Long categoryId,@Param("productId") Long productId, @Param("corpid")String corpid);
}